
<script type="text/javascript" src="../jquery/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
	<!--
		
		$(document).ready(function() {
			$("#updateDetail").click(function(){
				var size = $("#size").val();
				var i = 0;
				var str="";
				for(var i=1; i<=size; i++) {
					var id = $("#id" + i).val();
					var answerName = "answer"+i;
					var selValue = $("input[name='"+answerName+"']:checked").val();
					if(str == "") {
						str = id +","+ selValue;
					}else {
						str += ";" +id +","+ selValue;
					}
				}
			alert(str);
			$.post("../details/updateDetails.do",
				{	
					string : str,
				},
				function (data){
					 if(data == "OK") {
					 	alert('提交成功');
					 <!--	window.location.href='../index.do'; -->
					 }else {
					 	alert('提交失败');
					 }
				}); 
            }); 
		}); 
	//-->
	</script>
 <table>
 		<input type="hidden" id="size" value="${list?size}" />
    	<#list list as details>
    	<tr>
    		<td colspan="2">
				<label>
					${details_index + 1}, ${details.title }
					<input type="hidden" id="id${details_index + 1}" value="${details.id}">
				</label>
    		<td>
    	<tr>
    	<tr>
    		<td>
				<input type="radio" name="answer${details_index + 1}" id="answer1" value="1">
				${details.answer1}
    		<td>
    		
    		<td>
				<input type="radio" name="answer${details_index + 1}" id="answer2" value="2">
				${details.answer2 }
    		<td>
    	<tr>
    	<tr>
    		<td>
				<input type="radio" name="answer${details_index + 1}" id="answer3" value="3">
				${details.answer3 }
    		<td>
    		
    		<td>
				<input type="radio" name="answer${details_index + 1}" id="answer4" value="4">
				${details.answer4 }
    		<td>
    	<tr>
    	</#list> 
    	<tr>
    		<td colspan="2">
				<input type="submit" id="updateDetail">
    		<td>
    	<tr>
    </table>
